package model

import (
	"gorm.io/gorm"
	"time"
)

type Message struct {
	Id        uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	VideoId   uint           `gorm:"column:video_id;type:bigint UNSIGNED;not null;default:0;" json:"video_id"`
	Message   string         `gorm:"column:message;type:varchar(255);not null;" json:"message"`
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
	Num       uint           `gorm:"column:num;type:bigint UNSIGNED;not null;default:0;" json:"num"`
}

func (m *Message) TableName() string {
	return "message"
}
